﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="TableEdit.aspx.cs" Inherits="CodeAuto.Pages.TableEdit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div style="min-height: 600px;">
        <h2>
            添加数据表
        </h2>
        <p>
            请输入表信息。
            <asp:HyperLink ID="RegisterHyperLink" runat="server" EnableViewState="false">返回</asp:HyperLink>
        </p>
        <span class="failureNotification">
            <asp:Literal ID="FailureText" runat="server"></asp:Literal>
        </span>
        <div class="accountInfo">
            <fieldset class="login">
                <legend>数据表信息</legend>
                <p>
                    <asp:Label ID="TableNameLabel" runat="server">数据表名称:</asp:Label>
                    <asp:TextBox ID="TableName" runat="server" CssClass="textEntry"></asp:TextBox>
                </p>
                <p>
                    <asp:Label ID="Label1" runat="server">备 注 名 称:</asp:Label>
                    <asp:TextBox ID="TextBox1" runat="server" CssClass="textEntry"></asp:TextBox>
                </p>
            </fieldset>
            <fieldset class="login">
                <legend>字段信息</legend>
                <div id="fields">
                    <%
                        for (int i = 0; i < 50; i++)
                        {
                            if (i < fields.Count)
                            {
                                Response.Write("<p>字段：<input type=\"text\" id=\"f" + i + "\" name=\"f" + i + "\" value=\"" + fields[i].Field + "\" /> 备注：<input type=\"text\" id=\"n" + i + "\" name=\"n" + i + "\" value=\"" + fields[i].FieldName + "\"  />");
                                if (fields[i].Attr.Equals("string"))
                                {
                                    Response.Write(" <input type=\"radio\" name=\"add" + i + "\" value=\"string\"  checked=\"checked\" />String");
                                }
                                else
                                {
                                    Response.Write(" <input type=\"radio\" name=\"add" + i + "\" value=\"string\"/>String");
                                }
                                if (fields[i].Attr.Equals("DateTime"))
                                {
                                    Response.Write(" <input type=\"radio\" name=\"add" + i + "\" value=\"DateTime\"  checked=\"checked\"/>DateTime");
                                }
                                else
                                {
                                    Response.Write(" <input type=\"radio\" name=\"add" + i + "\" value=\"DateTime\" />DateTime");
                                }
                                if (fields[i].Attr.Equals("int"))
                                {
                                    Response.Write(" <input type=\"radio\" name=\"add" + i + "\" value=\"int\" checked=\"checked\"/>Int");
                                }
                                else
                                {
                                    Response.Write(" <input type=\"radio\" name=\"add" + i + "\" value=\"int\"  />Int");
                                }
                                if (fields[i].Attr.Equals("double"))
                                {
                                    Response.Write(" <input type=\"radio\" name=\"add" + i + "\" value=\"double\"  checked=\"checked\" />Double");
                                }
                                else
                                {
                                    Response.Write(" <input type=\"radio\" name=\"add" + i + "\" value=\"double\"/>Double");
                                }
                            }
                            else
                            {
                                Response.Write("<p>字段：<input type=\"text\" id=\"f" + i + "\" name=\"f" + i + "\" /> 备注：<input type=\"text\" id=\"n" + i + "\" name=\"n" + i + "\" /> <input type=\"radio\" name=\"add" + i + "\" value=\"string\" />String&nbsp;<input type=\"radio\" name=\"add" + i + "\" value=\"DateTime\" />DateTime&nbsp;<input type=\"radio\" name=\"add" + i + "\" value=\"int\" />Int<input type=\"radio\" name=\"add" + i + "\" value=\"double\" />Double</p>");
                            }
                        }
                    %>
                </div>
            </fieldset>
            <p class="submitButton">
                <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="确定" OnClick="LoginButton_Click"
                    ValidationGroup="LoginUserValidationGroup" />
            </p>
        </div>
    </div>
</asp:Content>
